package com.dyit.springcloud.common.dto;

import lombok.Data;
import lombok.Getter;
import lombok.ToString;

import java.time.LocalDateTime;

@Data
@Getter
@ToString
public class HttpResp {
    private int code;
    private String msg;
    private Object results;
    private LocalDateTime time;

    public HttpResp() {
    }

    public HttpResp(Builder builder) {
        this.code=builder.code;
        this.msg=builder.msg;
        this.results=builder.results;
        this.time=builder.time;
    }


    public static class Builder{
        private int code;
        private String msg;
        private Object results;
        private LocalDateTime time;

        public Builder code(int code){
            this.code=code;
            return this;
        }

        public Builder msg(String msg){
            this.msg=msg;
            return this;
        }

        public Builder results(Object results){
            this.results=results;
            return this;
        }

        public Builder time(LocalDateTime time){
            this.time=time;
            return this;
        }

        public HttpResp builder(){
            return new HttpResp(this);
        }
    }
}
